import { Module } from '@nestjs/common';
import { UserModule } from './user/user.module';
import { DatabaseModule } from './common/database';
import { AuthModule } from './auth/auth.module';
import { APP_GUARD } from '@nestjs/core';
import { JwtAuthGuard } from './auth/jwt-auth.guard';
import { RoleModule } from './role/role.module';
import { MenuModule } from './menu/menu.module';
import { IdModule } from './common/snow-flake';

@Module({
  imports: [
    DatabaseModule,
    IdModule,
    AuthModule,
    UserModule,
    RoleModule,
    MenuModule,
  ],
  providers: [
    { provide: APP_GUARD, useClass: JwtAuthGuard }, // ✅ 全局守卫
  ],
})
export class AppModule {}
